package routers

import (
	"github.com/gin-contrib/cors"
	"github.com/gin-gonic/gin"
	"post-admin/handlers"
)

func Init() *gin.Engine {
	r := gin.Default()
	r.Use(cors.Default())
	r.POST("/user/login", handlers.UserLogin)
	r.GET("/post/list", handlers.PostList)
	r.GET("/post/detail", handlers.PostDetail)
	return r
}
